from lib.w.widget.base import Base

class CheckButton(Base):

	def __init__(self, w):
		self.w = w

	def set_value(self, value=False):

		if value or str(value).lower() in ['1', 'true', 't']:
			value = True
		else:
			value = False

		self.w.set_active(value)

	def get_value(self):

		return self.w.get_active()

	def clear(self):

		self.w.set_active(False)
